package org.jsbd.boss.dao.impl;

import java.util.List;

import org.jsbd.boss.dao.IInviteCodeDao;
import org.jsbd.boss.domian.InviteCodeBean;
import org.springframework.stereotype.Repository;

import edu.hziee.common.queue.IBatchExecutor;

@Repository("inviteCodeDao")
public class InviteCodeDaoImpl extends CrackBaseDao implements IBatchExecutor<InviteCodeBean>, IInviteCodeDao {

	@Override
	public void saveInviteCode(InviteCodeBean inviteCode) {
		super.insert("qy_channel_invite_code.insert_invite_code", inviteCode);
	}

	@Override
	public void updateInviteCode(InviteCodeBean inviteCode) {
		super.update("qy_channel_invite_code.update_invite_code", inviteCode);
	}

	@Override
	public void updateInviteCode(List<InviteCodeBean> inviteCodeList) {
		super.batchUpdate("qy_channel_invite_code.update_invite_code", inviteCodeList);
	}

	@Override
	public void execute(List<InviteCodeBean> records) {
		super.batchInsert("qy_channel_invite_code.insert_invite_code", records);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jsbd.boss.dao.IInviteCodeDao#getInviteCodeList(java.lang.String,
	 * int)
	 */
	@Override
	public List<InviteCodeBean> getInviteCodeList(String mark) {
		return super.queryForList("qy_channel_invite_code.get_invite_code_list", mark);
	}

	@Override
	public InviteCodeBean getByParentCode(String parentCode) {
		return (InviteCodeBean) super.queryForObject("qy_channel_invite_code.SELECT_BY_PARENT_CODE", parentCode);
	}

}
